#pragma once

#include "cache.h"

namespace icache {

class mem_cache;
class disc_cache;

///the purpose of coordinator is to load images when disc_cache and/or mem_cache exist
class coordinator : public cache {
public:
	mem_cache * mc;
	disc_cache * dc;
public:
	coordinator(mem_cache * m = 0, disc_cache * d = 0) : mc(m), dc(d) { }
public: //cache interface
	virtual void put(cached_image_sptr const & c, last_used_position p = most_recently_used);
	virtual cached_image_sptr get(item_id_sptr const & id, last_used_position p = most_recently_used);
	virtual cached_image_sptr try_get(item_id_sptr const & id, last_used_position p = most_recently_used);
	virtual bool touch(item_id_sptr const & id, last_used_position p = most_recently_used);
	virtual void remove(item_id_sptr const & id);
	virtual void purge();
};

} //namespace icache
